package com.baselibrary.test.MVP.MainActivity.presenter;


import com.baselibrary.test.MVP.MainActivity.contract.MainContract;
import com.baselibrary.test.MVP.mvpBase.baseInterFace.MvpModelCallBack;
import com.baselibrary.test.MVP.mvpBase.netWorkModel.netWorkModel;
import com.baselibrary.libs.example.example_listView.bean.itemData;

import java.util.ArrayList;

/**
 * Created by 35876 于萌萌
 * 创建日期: 18:57 . 2017年01月29日
 * 描述:
 * <p>
 * <p>
 * 备注:
 */
public class MainPresenter implements MainContract.Presenter{
    netWorkModel mModel;
    MainContract.View mView;

    public MainPresenter(MainContract.View view) {
        mView = view;
        mModel = new netWorkModel();
    }


    @Override
    public void getData() {
        mModel.getListViewData(null, new MvpModelCallBack<ArrayList<itemData>,String>() {
            @Override
            public void success(ArrayList<itemData> itemDatas) {
                mView.ListData_success(itemDatas);
            }

            @Override
            public void failure(String s) {
                mView.ListData_failure(s);
            }

        });
    }
}
